# -*- coding: UTF-8 -*-
'''
Created on 2018年3月20日 下午4:36:29

@author: wqp0010@gmail.com
'''

class Site:
    '''
    classdocs
    '''
    

    def __init__(self, name, url):
        self.name = name
        self.__url = url
    
    def who(self):
        print('name : ' , self.name)
        print('url : ', self.__url)
    
    def __foo(self):
        print('这是私有方法')
    
    def foo(self):
        print('这是公共方法')
        self.__foo()

x = Site('百度', 'www.baidu.com')
x.who()
x.foo()
#报错
x.__foo()
